package com.wly.ui.common
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class ProgressBar extends MovieClip
	{
		private var _tfText:TextField;
		private var _mcBar:MovieClip;
		
		public function ProgressBar()
		{
			super();
			stop();
			_tfText = getChildByName("tfExp") as TextField;
		}
		
		public function updateProgress(curVal:int, totalVal:int):void
		{
			var rate:int = curVal*100/totalVal;
			if(_tfText)
			{
				_tfText.text = curVal.toString()+"/"+totalVal.toString();
			}
			if(rate>=100)
			{
				rate = 100;
			}
			gotoAndStop(rate);
		}
	}
}